/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jimu.longkong.web.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Repository;  
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
/**
 *
 * @author mazhiqiang
 */
@Repository  
public class LoginInterceptor implements HandlerInterceptor {  
    @Override   
    public boolean preHandle(HttpServletRequest hsr, HttpServletResponse response, Object handler) throws Exception {  
//        Cache.init();
        System.err.println("----------------->preHandle");
        return true;
    }

    @Override
    public void postHandle(HttpServletRequest hsr, HttpServletResponse hsr1, Object o, ModelAndView mav) throws Exception {
        mav.addObject("ROOT", "/JimuWeb");
        System.err.println("----------------->postHandle");
//        if(u == null || u.getId() == null){
//        }
    }

    @Override
    public void afterCompletion(HttpServletRequest hsr, HttpServletResponse hsr1, Object o, Exception excptn) throws Exception {
        System.err.println("----------------->afterCompletion");
    }
}  